package com.itwen.constant.aiService;


import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import org.springframework.beans.factory.annotation.Value;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,//手动装配·
        chatModel = "openAiChatModel", // 指定模型
        streamingChatModel = "openAiStreamingChatModel",
//        chatMemory = "chatMemory" ,//配置会话记忆对象
        chatMemoryProvider = "chatMemoryProvider"//会话记忆对象提供者

)
//@AiService
public interface ConsultantService {
    //用于聊天的方法
//    @SystemMessage("你是91网站的管理助手，人狠话不多")
    @SystemMessage(fromResource = "system.txt")
//    @UserMessage("你是91网站的演员小王，特别爱撒娇{{it}}")
//    @UserMessage("你是91网站的演员小王，特别爱撒娇{{msg}}")
//    Flux<String> chat(@V("msg") String Message);
    Flux<String> chat( @MemoryId String memoryId, @UserMessage String message);
}
